package com.zsqat.eshop.product.entity;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import com.zsqat.common.valid.AddGroup;
import com.zsqat.common.valid.ListValue;
import com.zsqat.common.valid.UpdateGroup;
import com.zsqat.common.valid.UpdateStatusGroup;
import lombok.Data;
import org.hibernate.validator.constraints.URL;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Null;

/**
 * 品牌
 * 
 * @author zsqat
 * @email 491192853@qq.com
 * @date 2020-11-19 16:40:59
 */
@Data
@TableName("pms_brand")
public class BrandEntity implements Serializable {
	private static final long serialVersionUID = 1L;

	/**
	 * 品牌id，新增时，在配置文件已经配置过 Id 自增的(id-type: auto )。
	 */
	@NotNull(message = "修改时必须指定品牌Id", groups = {UpdateGroup.class})
	@Null(message = "新增时不需要指定品牌Id", groups = {AddGroup.class})
	@TableId
	private Long brandId;
	/**
	 * 品牌名
	 */
	@NotBlank(message = "品牌名不能为空", groups = {AddGroup.class, UpdateGroup.class})
	private String name;
	/**
	 * 品牌logo地址
	 */
	@NotBlank(groups = {AddGroup.class})
	@URL(message = "logo 必须是一个合法的url地址", groups = {AddGroup.class, UpdateGroup.class})
	private String logo;
	/**
	 * 介绍
	 */
	private String descript;
	/**
	 * 显示状态[0-不显示；1-显示]
	 */
	@NotNull(groups = {AddGroup.class, UpdateStatusGroup.class})
	private Integer showStatus;
	/**
	 * 检索首字母
	 */
	private String firstLetter;
	/**
	 * 排序
	 */
	@ListValue(message = "排序字段必须是[1,100]内的一个值", vals={0,1}, groups = {AddGroup.class, UpdateStatusGroup.class})
	private Integer sort;

}
